package com.heima.search.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import com.heima.search.service.IApAssociateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 联想词控制层
 *
 * @Author : wuqiang
 * @date : 2022年10月23日
 */
@RestController
@RequestMapping("/api/v1/associate")
public class ApAssociateController {

    @Autowired
    private IApAssociateService apAssociateService;

    /**
     * 联想词查询
     *
     * @param dto dto
     * @return {@link ResponseResult}
     */
    @PostMapping("/search")
    public ResponseResult searchAssociate(@RequestBody ApArticleSearchDto dto) {
        return apAssociateService.searchAssociate(dto);
    }
}
